﻿<UserControl x:Class="StockholmsStad.Windows.UI.Modules.Maintenance.Views.ScheduleGenerateTimeView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:DateControls="clr-namespace:Microsoft.Samples.KMoore.WPFSamples.DateControls;assembly=J832.Wpf.BagOTricksLib">
    
    <Grid x:Name="xGrid" Margin="10,10,10,10">
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <GroupBox Header="Generering" Grid.Column="0" Padding="0,10,5,5" VerticalAlignment="Top" HorizontalAlignment="Left">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Label Grid.Row="0" Grid.Column="0" Content="Startdatum:" Target="{Binding ElementName=datePickerStart}" />
                <Label Grid.Row="1" Grid.Column="0" Content="Slutdatum:" Target="{Binding ElementName=datePickerEnd}" />
                <Label Grid.Row="2" Grid.Column="0" Content="Starttid:" />
                <Label Grid.Row="3" Grid.Column="0" Content="Sluttid:" />
                <Label Grid.Row="4" Grid.Column="0" Content="Intervall:" />
                

                <DateControls:DatePicker x:Name="datePickerStart" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="0" Grid.Column="1" Language="sv-SE"
                                 Value="{Binding StartDate, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" />

                <DateControls:DatePicker x:Name="datePickerEnd" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="1" Grid.Column="1" Language="sv-SE"
                                 Value="{Binding EndDate, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"  />

                <TextBox x:Name="tbStartTime" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" 
                 Text="{Binding StartTime, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                 Validation.ErrorTemplate="{DynamicResource ErrorTemplate}" Style="{DynamicResource TextBoxInError}" />

                <TextBox x:Name="tbEndTime" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Stretch" 
                 Text="{Binding EndTime, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" 
                 Validation.ErrorTemplate="{DynamicResource ErrorTemplate}" Style="{DynamicResource TextBoxInError}" />

                <ComboBox x:Name="cbInterval" Grid.Row="4" Grid.Column="1" Text="" HorizontalAlignment="Stretch" SelectedValue="{Binding Interval}" />
                
                <CheckBox x:Name="cbIncludeAnotherDay" Content="Generera annan dag än lördag" IsChecked="{Binding IncludeAnotherDay}" Grid.Row="5" Grid.ColumnSpan="2"
                          Margin="5,10,0,0" Padding="6,0,0,0" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked" VerticalAlignment="Center" />

                <Button Grid.Row="6" Grid.ColumnSpan="2" Content="Generera" HorizontalAlignment="Right" 
                        Margin="0,15,0,0" Width="70" Height="24" Command="{Binding GenerateCommand}" />
            </Grid>
        </GroupBox>

        <!--<views:GeneratedMonthsView Grid.Column="1" />-->

    </Grid>
</UserControl>
